package com.enn.demo.application;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.enn.demo.client.TenantQueryService;
import com.enn.demo.client.common.PageUtil;
import com.enn.demo.core.domain.repository.TenantRepository;
import com.enn.demo.application.assembler.PageAssembler;
import com.enn.demo.core.domain.util.mybatis.Query;
import com.enn.demo.dal.entity.SysTenantDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 租户查询服务实现类
 *
 * @author haoxin
 * @date 2021-05-10
 **/
@Service
public class TenantQueryServiceImpl implements TenantQueryService {

    @Autowired
    private TenantRepository tenantRepository;

    @Override
    public PageUtil queryPage(Map<String, Object> params) {
        IPage<SysTenantDO> page = tenantRepository.queryPage(params);
        return PageAssembler.toPage(page);
    }
}
